using System.Security.Claims;


namespace DaprPlus.Authorization;

/// <summary>
/// 角色名称解析器接口
/// </summary>
public interface IRoleNameResolver
{
    /// <summary>
    /// 从身份信息中获取角色名称列表并解析为角色ID列表
    /// </summary>
    /// <param name="identity">身份信息</param>
    /// <returns>角色ID列表</returns>
    Task<long[]> ResolveRoleIds(ClaimsIdentity identity);

    /// <summary>
    /// 从角色名称列表解析为角色ID列表
    /// </summary>
    /// <param name="roleNames">角色名称列表</param>
    /// <returns>角色ID列表</returns>
    Task<long[]> ResolveRoleIds(string[] roleNames);

    /// <summary>
    /// 从角色编号列表解析为角色名称列表
    /// </summary>
    /// <param name="roleIds">角色编号列表</param>
    /// <returns></returns>
    Task<string[]> ResolveRoleName(long[] roleIds);
}
